# coding: utf-8
# Author: Legend奇
# @Time： 2020/11/27 上午9:55
from base.base_schema import BaseSchema


class AlarmSchema(BaseSchema):
    class Meta:
        fields = ('id', 'status', 'firing_value', 'inactive_value', 'endpoint', 'config', 'create_timestamp',
                  'update_timestamp', 'clear_timestamp', 'notify_timestamp')


class AlarmConfigSchema(BaseSchema):
    class Meta:
        fields = ('name', 'level', 'for_time', 'message_template', 'snmp_alarm', 'device', 'judge_sign', 'statfield',
                  'threshold', 'alarm_contact_group', 'tags', 'troubleshoot', 'notify_duration')


class AlarmSilenceSchema(BaseSchema):
    class Meta:
        fields = ('name', 'metrics', 'endpoints', 'start_timestamp', 'end_timestamp', 'comments')


class AlarmConfigGroupSchema(BaseSchema):
    class Meta:
        fields = ('name', 'description')


class AlarmContactSchema(BaseSchema):
    class Meta:
        fields = ('name', 'email', 'cellphone')


class AlarmContactGroupSchema(BaseSchema):
    class Meta:
        fields = ('name', 'channel', 'description', 'contact')


class AlarmHandleSchema(BaseSchema):
    class Meta:
        fields = ('desc', 'alarm_config')


class EmailProxySchema(BaseSchema):
    class Meta:
        fields = ('host', 'port', 'user', 'password', 'tls', 'ssl', 'enable_proxy', 'proxy_host', 'proxy_port')


class SmsApiSchema(BaseSchema):
    class Meta:
        fields = ('sms_api',)
